Right-justify labels in rtl mode. (#129071, chinen@jp.ibm.com)
authorMatthias Clasen <maclas@gmx.de>
Tue, 3 Feb 2004 01:03:56 +0000 (01:03 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 3 Feb 2004 01:03:56 +0000 (01:03 +0000)
Tue Feb  3 02:04:44 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtklabel.c (gtk_label_ensure_layout): Right-justify labels
in rtl mode.  (#129071, chinen@jp.ibm.com)

Tue Feb  3 02:01:25 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current): Exchange the
meaning GTK_MENU_DIR_PARENT/CHILD and GTK_MENU_DIR_PREV/NEXT in rtl
mode.  (#107528)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtklabel.c
gtk/gtkmenushell.c

index 6602c9955e3401c4a5ff865707fb348b6cc1462c..3c44f74ad60086be40ab2420ebe4d13c5fc57d21 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Tue Feb  3 02:04:44 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtklabel.c (gtk_label_ensure_layout): Right-justify labels
+       in rtl mode.  (#129071, chinen@jp.ibm.com)
+
+Tue Feb  3 02:01:25 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkmenushell.c (gtk_real_menu_shell_move_current): Exchange the
+       meaning GTK_MENU_DIR_PARENT/CHILD and GTK_MENU_DIR_PREV/NEXT in rtl
+       mode.  (#107528)
+
 Tue Feb  3 01:38:06 2004  Matthias Clasen  <maclas@gmx.de>
 
        Clip narrow columns in rtl-oriented tree views (#128089,  
index 6602c9955e3401c4a5ff865707fb348b6cc1462c..3c44f74ad60086be40ab2420ebe4d13c5fc57d21 100644 (file)
@@ -1,3 +1,14 @@
+Tue Feb  3 02:04:44 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtklabel.c (gtk_label_ensure_layout): Right-justify labels
+       in rtl mode.  (#129071, chinen@jp.ibm.com)
+
+Tue Feb  3 02:01:25 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkmenushell.c (gtk_real_menu_shell_move_current): Exchange the
+       meaning GTK_MENU_DIR_PARENT/CHILD and GTK_MENU_DIR_PREV/NEXT in rtl
+       mode.  (#107528)
+
 Tue Feb  3 01:38:06 2004  Matthias Clasen  <maclas@gmx.de>
 
        Clip narrow columns in rtl-oriented tree views (#128089,  
index 6602c9955e3401c4a5ff865707fb348b6cc1462c..3c44f74ad60086be40ab2420ebe4d13c5fc57d21 100644 (file)
@@ -1,3 +1,14 @@
+Tue Feb  3 02:04:44 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtklabel.c (gtk_label_ensure_layout): Right-justify labels
+       in rtl mode.  (#129071, chinen@jp.ibm.com)
+
+Tue Feb  3 02:01:25 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkmenushell.c (gtk_real_menu_shell_move_current): Exchange the
+       meaning GTK_MENU_DIR_PARENT/CHILD and GTK_MENU_DIR_PREV/NEXT in rtl
+       mode.  (#107528)
+
 Tue Feb  3 01:38:06 2004  Matthias Clasen  <maclas@gmx.de>
 
        Clip narrow columns in rtl-oriented tree views (#128089,  
index 6602c9955e3401c4a5ff865707fb348b6cc1462c..3c44f74ad60086be40ab2420ebe4d13c5fc57d21 100644 (file)
@@ -1,3 +1,14 @@
+Tue Feb  3 02:04:44 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtklabel.c (gtk_label_ensure_layout): Right-justify labels
+       in rtl mode.  (#129071, chinen@jp.ibm.com)
+
+Tue Feb  3 02:01:25 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkmenushell.c (gtk_real_menu_shell_move_current): Exchange the
+       meaning GTK_MENU_DIR_PARENT/CHILD and GTK_MENU_DIR_PREV/NEXT in rtl
+       mode.  (#107528)
+
 Tue Feb  3 01:38:06 2004  Matthias Clasen  <maclas@gmx.de>
 
        Clip narrow columns in rtl-oriented tree views (#128089,  
index 6602c9955e3401c4a5ff865707fb348b6cc1462c..3c44f74ad60086be40ab2420ebe4d13c5fc57d21 100644 (file)
@@ -1,3 +1,14 @@
+Tue Feb  3 02:04:44 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtklabel.c (gtk_label_ensure_layout): Right-justify labels
+       in rtl mode.  (#129071, chinen@jp.ibm.com)
+
+Tue Feb  3 02:01:25 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkmenushell.c (gtk_real_menu_shell_move_current): Exchange the
+       meaning GTK_MENU_DIR_PARENT/CHILD and GTK_MENU_DIR_PREV/NEXT in rtl
+       mode.  (#107528)
+
 Tue Feb  3 01:38:06 2004  Matthias Clasen  <maclas@gmx.de>
 
        Clip narrow columns in rtl-oriented tree views (#128089,  
index f26e99abcf6c2f110a21683aa8b31fa27c9abd11..b835c2a79d353fc58827e485bcb9cc2af9dc795b 100644 (file)
@@ -1408,9 +1408,11 @@ gtk_label_ensure_layout (GtkLabel *label)
   GtkWidget *widget;
   PangoRectangle logical_rect;
   gint rwidth, rheight;
+  gboolean rtl;
 
   widget = GTK_WIDGET (label);
 
+  rtl = gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL;
   rwidth = label->misc.xpad * 2;
   rheight = label->misc.ypad * 2;
 
@@ -1426,17 +1428,17 @@ gtk_label_ensure_layout (GtkLabel *label)
       switch (label->jtype)
        {
        case GTK_JUSTIFY_LEFT:
-         align = PANGO_ALIGN_LEFT;
+         align = rtl ? PANGO_ALIGN_RIGHT : PANGO_ALIGN_LEFT;
          break;
        case GTK_JUSTIFY_RIGHT:
-         align = PANGO_ALIGN_RIGHT;
+         align = rtl ? PANGO_ALIGN_LEFT : PANGO_ALIGN_RIGHT;
          break;
        case GTK_JUSTIFY_CENTER:
          align = PANGO_ALIGN_CENTER;
          break;
        case GTK_JUSTIFY_FILL:
          /* FIXME: This just doesn't work to do this */
-         align = PANGO_ALIGN_LEFT;
+         align = rtl ? PANGO_ALIGN_RIGHT : PANGO_ALIGN_LEFT;
          pango_layout_set_justify (label->layout, TRUE);
          break;
        default:
index 5fe743fc6078de0ddbf115cef05f860a7b3c9045..514d9b5aa6e3cd535af5f0b7e0b8f93ed9680e68 100644 (file)
@@ -1042,6 +1042,28 @@ gtk_real_menu_shell_move_current (GtkMenuShell      *menu_shell,
   if (menu_shell->parent_menu_shell)
     parent_menu_shell = GTK_MENU_SHELL (menu_shell->parent_menu_shell);
   
+  if (gtk_widget_get_direction (GTK_WIDGET (menu_shell)) == GTK_TEXT_DIR_RTL)
+    {
+      switch (direction) 
+       {
+       case GTK_MENU_DIR_PARENT:
+         direction = GTK_MENU_DIR_CHILD;
+         break;
+       case GTK_MENU_DIR_CHILD:
+         direction = GTK_MENU_DIR_PARENT;
+         break;
+       case GTK_MENU_DIR_PREV:
+         if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement == GTK_TOP_BOTTOM)
+           direction = GTK_MENU_DIR_NEXT;
+         break;
+       case GTK_MENU_DIR_NEXT:
+         if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement == GTK_TOP_BOTTOM)
+           direction = GTK_MENU_DIR_PREV;
+         break;
+       default: ;
+       }
+    }
+  
   switch (direction)
     {
     case GTK_MENU_DIR_PARENT: